package com.qf.aop;

import org.springframework.aop.AfterAdvice;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.ThrowsAdvice;
import org.springframework.stereotype.Repository;

import java.lang.reflect.Method;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/26 19:14
 */
//@Repository
public class Advice implements MethodBeforeAdvice, AfterReturningAdvice {
    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {
        System.out.println("开始添加用户");
    }

    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
        System.out.println("添加用户完成");
    }
}
